package com.yuyue.springFramework.note11.entity.code;

import org.springframework.context.ApplicationListener;

/**
 * 创建事件类 OrderCreateEvent 的监听器
 * 实现Spring监听器接口，并以事件类作为参数
 */
public class OrderCreateEventListener implements ApplicationListener<OrderCreateEvent> {
    @Override
    public void onApplicationEvent(OrderCreateEvent event) {
        System.out.println(String.format("创建订单【%s】成功", event.getOrderId()));
    }
}
